javascript screen size

57

get the size of the screen javascript -

window.screen.height;
window.screen.width;

js know size of screen displayed -

var win = window,
    doc = document,
    docElem = doc.documentElement,
    body = doc.getElementsByTagName('body')[0],
    x = win.innerWidth || docElem.clientWidth || body.clientWidth,
    y = win.innerHeight|| docElem.clientHeight|| body.clientHeight;
alert(x + ' × ' + y);

Comments

Submit
0 Comments